#!/bin/bash
build_path=build 
if [ ! -d ${build_path} ];then
mkdir ${build_path}
fi 
cd ${build_path}
cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local \
          -DOPENCV_ENABLE_NONFREE=ON \
          -DWITH_CUDA=ON \
          -DENABLE_FAST_MATH=1 \
          -DCUDA_FAST_MATH=1 \
          -DWITH_CUBLAS=1 \
          -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_opencv_ts=OFF\
          -DOPENCV_EXTRA_MODULES_PATH=/home/liushuai/opencv_contrib/modules \
          -DBUILD_opencv_aruco=ON -DBUILD_opencv_bgsegm=ON -DBUILD_opencv_bioinspired=ON \
          -DBUILD_opencv_ccalib=ON -DBUILD_opencv_datasets=ON \
          -DBUILD_opencv_dnn_objdetect=ON -DBUILD_opencv_dpm=ON -DBUILD_opencv_face=ON \
          -DBUILD_opencv_fuzzy=ON -DBUILD_opencv_hfs=ON -DBUILD_opencv_img_hash=ON \
          -DBUILD_opencv_js=OFF -DBUILD_opencv_line_descriptor=ON -DBUILD_opencv_phase_unwrapping=ON \
          -DBUILD_opencv_plot=ON -DBUILD_opencv_quality=ON -DBUILD_opencv_reg=ON \
          -DBUILD_opencv_rgbd=ON -DBUILD_opencv_cvv=ON -DBUILD_opencv_saliency=ON -DBUILD_opencv_shape=ON \
          -DBUILD_opencv_structured_light=ON -DBUILD_opencv_surface_matching=ON -DBUILD_opencv_python3=ON\
          -DBUILD_opencv_world=ON -DBUILD_opencv_xobjdetect=ON -DBUILD_opencv_xphoto=ON
make -j16
sudo make install
